# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pythonaes
pkgname=('python2-pythonaes' 'python-pythonaes')
_pkgname=pythonaes
pkgver=1.0
pkgrel=7
pkgdesc='Pure Python implementation of AES for 2.7 or 3.x.'
url='https://pypi.org/project/pythonaes/#files'
arch=('any')
license=('custom:unknown')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('1e812307c9213f0a44bed738d5fd592adcbd26507da87312955aebffa0a4e7adba504cb73707b95d2d357927f10617d93af6383ab829a95156fdc19719e9dd3c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pythonaes() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pythonaes() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

